package com.xuzimian.globaldemo.designpatterns.observer.custom;

/**
 * @program: global-demo
 * @description:
 * @author: xzm
 * @create: 2019-08-22 16:21
 **/
public class ObserverDemo {

    public static void main(String[] args) {

        //被观察者
        WeatherData weatherData = new WeatherData();

        //观察者对象
        CurrentConditionsDisplay conditionsDisplay = new CurrentConditionsDisplay(weatherData);
        StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
        ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);

        weatherData.setMeasurements(80, 85, 90);

    }

}
